<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:panel id="Edit">
		<h:panelGrid>


			<a4j:form>
				<h:panelGrid columns="2">
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Tipo Telefono</ui:define>
							<rich:comboBox value="#{editPerson.editPhone.phoneType}" 
								id="PhoneType"
								converter="#{refConverter}"
								converterMessage="Favor seleccione el tipo de telefono"
								defaultLabel="Seleccione tipo de telefono"
								enableManualInput="true"
								required="true"
								requiredMessage="Favor seleccione el tipo de telefono"
								>
															
									<s:selectItems  value="#{withinHolder.refDetListByHeadCod(editPerson.phoneType)}" var="ref" label="#{ref.descrip}">
									</s:selectItems>
									
							</rich:comboBox>
							<div class="msg_container">
								<rich:message for="PhoneType" />
							</div>
						</s:decorate>
		
						<div style="clear: both;" />
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Telefono</ui:define>
							<h:inputText id="Phone" maxlength="40"
								value="#{editPerson.editPhone.phone}"
								required="true" size="30"
								requiredMessage="Favor introduzca el nro de telefono"
								validatorMessage="El nro de telefono no puede ser menor a 5 o mayor a 25">
								<f:validateLength minimum="5" maximum="25" />
								<a4j:support event="onblur" ajaxSingle="true" />
							</h:inputText>
							<div class="msg_container">
								<rich:message for="Phone" />
							</div>
						</s:decorate>
						<div style="clear: both" />
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Activo</ui:define>
							<h:selectBooleanCheckbox id="PhoneActive"
								value="#{editPerson.editPhone.status}">
								<a4j:support event="onblur" ajaxSingle="true" />
								<a4j:support event="onclick" ajaxSingle="true">
									<s:conversationId />
								</a4j:support>
							</h:selectBooleanCheckbox>
						</s:decorate>
						
						<div style="clear: both" />
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Default</ui:define>
							<h:selectBooleanCheckbox id="PhoneDefault"
								value="#{editPerson.editPhone.isDefault}">
								<a4j:support event="onblur" ajaxSingle="true" />
								<a4j:support event="onclick" ajaxSingle="true">
									<s:conversationId />
								</a4j:support>
							</h:selectBooleanCheckbox>
						</s:decorate>
						

					</h:panelGrid>
						
		
				<s:decorate template="/layout/displayButton.xhtml">
					<a4j:commandButton value="Guardar"
						action="#{editPerson.phoneUpd()}"
						oncomplete="#{rich:component('PersonPhoneModalPanel')}.hide()"
						reRender="updPersonPhoneForm, updPhoneGridForm" />
					<rich:spacer width="20px" />
					<h:commandButton value="Cancelar"
						oncomplete="#{rich:component('PersonPhoneModalPanel')}.hide()" />
				</s:decorate>
				</a4j:form>
		
		</h:panelGrid>
	</rich:panel>
</ui:composition>